var express = require('express');
var router = express.Router();


/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Express' });
});

// mongoose.connect('mongodb://localhost:27017/users', {useNewUrlParser:true},function(err) {
//   if(err){
//       console.log('连接失败');
//   }else{
//       console.log('连接成功');
//   }
//   if(!err){
//     var schema = new mongoose.Schema({ age:Number, name: String});        
//     var temp = mongoose.model('temp', schema);   
//     temp.create({name:"xiaowang",age:22},{name:"xiaoli",age:19},function(err,doc1,doc2){
//         //{ __v: 0, name: 'xiaowang', _id: 59720d83ad8a953f5cd04664 }
//         console.log(doc1); 
//         //{ __v: 0, name: 'xiaoli', _id: 59720d83ad8a953f5cd04665 }
//         console.log(doc2); 
//     });       
// }  
// });

module.exports = router;
